#pragma once

#include <boost/uuid/uuid.hpp>
#include <boostext/iostreams/bin_iostream.hpp>




namespace boost
{
	namespace uuids
	{
		/**
		 *Streaming operator to store a uuid in a basic_ostream.
		 */
		inline boostext::iostreams::bin_ostream& operator<<(boostext::iostreams::bin_ostream& stream, const uuid& tag)
		{
			for(auto i = tag.begin(); i != tag.end(); ++i)
				stream << *i;

			return stream;
		}
		///////////////////////////////////////////////////////////////////////////////////////////

		/**
		 *Streaming operator to restore a uuid from a basic_istream.
		 */
		inline boostext::iostreams::bin_istream& operator>>(boostext::iostreams::bin_istream& stream, uuid& tag)
		{
			for(auto i = tag.begin(); i != tag.end(); ++i)
				stream >> *i;

			return stream;
		}
		///////////////////////////////////////////////////////////////////////////////////////////
	}
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
